var a = wx.createInnerAudioContext();

a.loop = !0;

var t, d = getApp();

Page({
    data: {
        data_wenan: d.globalData.linkwenan,
        data_wenan2: "",
        data_animation: "headRotate 5s linear infinite",
        data_password: d.globalData.linkpassword,
        data_beijing: d.globalData.linkbeijing,
        data_peitu: d.globalData.linkpeitu,
        data_color: d.globalData.linkfontcolor,
        data_yyurl: d.globalData.linkmusicurl,
        data_sudu: d.globalData.linkfontspeed,
        data_yytp: "http://inews.gtimg.com/newsapp_ls/0/13215955736/0",
        data_a1: "",
        data_a2: "",
        data_a3: "",
        data_a4: "",
        data_bor1: "",
        data_bor2: "",
        data_bor3: "",
        data_bor4: "",
        data_a1_display: "",
        data_display: "none",
        data_tishi: "密码提示：你的生日",
        data_display2: "none",
        data_bor: "",
        data_col: "",
        data_bac: ""
    },
    view_B_a11_tap: function(a) {
        "headRotate 5s linear infinite" == this.data.data_animation ? (this.audioCtx.pause(), 
        this.setData({
            data_animation: "0",
            data_yytp: "http://inews.gtimg.com/newsapp_ls/0/13215956519/0"
        })) : (this.audioCtx.play(), this.setData({
            data_animation: "headRotate 5s linear infinite",
            data_yytp: "http://inews.gtimg.com/newsapp_ls/0/13215955736/0"
        }));
    },
    view_A3_tap: function(a) {
        var d = this;
        if ("ts" == a.currentTarget.dataset.content) this.setData({
            data_display: "block",
            data_tishi: "密码提示：Ta的生日"
        }); else if ("fh" == a.currentTarget.dataset.content) "" != this.data.data_bor4 ? this.setData({
            data_a4: "",
            data_bor4: ""
        }) : "" != this.data.data_bor3 ? this.setData({
            data_a3: "",
            data_bor3: ""
        }) : "" != this.data.data_bor2 ? this.setData({
            data_a2: "",
            data_bor2: ""
        }) : "" != this.data.data_bor1 && this.setData({
            data_a1: "",
            data_bor1: ""
        }); else if ("" == this.data.data_bor1) this.setData({
            data_a1: a.currentTarget.dataset.content,
            data_bor1: "6rpx solid rgb(255, 0, 127)",
            data_display: "none"
        }); else if ("" == this.data.data_bor2) this.setData({
            data_a2: a.currentTarget.dataset.content,
            data_bor2: "6rpx solid rgb(255, 0, 127)"
        }); else if ("" == this.data.data_bor3) this.setData({
            data_a3: a.currentTarget.dataset.content,
            data_bor3: "6rpx solid rgb(255, 0, 127)"
        }); else if ("" == this.data.data_bor4) {
            this.setData({
                data_a4: a.currentTarget.dataset.content,
                data_bor4: "6rpx solid rgb(255, 0, 127)"
            });
            var i = this.data.data_a1 + this.data.data_a2 + this.data.data_a3 + this.data.data_a4;
            this.data.data_password == i ? setTimeout(function() {
                d.setData({
                    data_bor: "5rpx solid #ff007f",
                    data_col: "#ff007f",
                    data_bac: "#fff",
                    data_display: "block",
                    data_tishi: "恭喜您，密码正确"
                }), setTimeout(function() {
                    d.setData({
                        data_a1_display: "none"
                    });
                    var a = 1;
                    t = setInterval(function() {
                        a <= d.data.data_wenan2.length ? (d.setData({
                            data_wenan: d.data.data_wenan2.substring(0, a),
                            data_display2: "block"
                        }), a += 1) : clearInterval(t);
                    }, d.data.data_sudu);
                }, 1e3);
            }, 300) : setTimeout(function() {
                wx.vibrateLong(), d.setData({
                    data_display: "block",
                    data_tishi: "密码错误，请重新输入",
                    data_a1: "",
                    data_bor1: "",
                    data_a2: "",
                    data_bor2: "",
                    data_a3: "",
                    data_bor3: "",
                    data_a4: "",
                    data_bor4: ""
                });
            }, 300);
        }
    },
    onLoad: function(t) {
        void 0 == t.wenan ? this.setData({
            data_password: d.globalData.linkpassword,
            data_wenan: d.globalData.linkwenan,
            data_wenan2: d.globalData.linkwenan,
            data_beijing: d.globalData.linkbeijing,
            data_peitu: d.globalData.linkpeitu,
            data_yyurl: d.globalData.linkmusicurl,
            data_color: d.globalData.linkfontcolor,
            data_size: d.globalData.linkfontsize,
            data_sudu: d.globalData.linkfontspeed
        }) : this.setData({
            data_password: t.password,
            data_wenan: t.wenan,
            data_wenan2: t.wenan,
            data_beijing: t.beijing,
            data_peitu: t.peitu,
            data_yyurl: t.musicurl,
            data_color: t.fontcolor,
            data_size: t.fontsize,
            data_sudu: t.fontspeed
        }), a.src = this.data.data_yyurl, a.play();
    },
    onUnload: function() {
        clearInterval(t), a.stop();
    },
    onShareAppMessage: function() {}
});